<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TMCStepper: src/source/TMC_platforms.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">TMCStepper
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_t_m_c__platforms_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">TMC_platforms.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_t_m_c__platforms_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#if defined(ARDUINO_ARCH_AVR) // 125kHz</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">volatile</span> uint8_t* fastio_reg;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;  <span class="keyword">typedef</span> uint8_t fastio_bm;</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">  #define getPort(P) digitalPinToPort(P)</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">  #define writeMOSI_H *mosi_register |= mosi_bm</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">  #define writeMOSI_L *mosi_register &amp;= ~mosi_bm</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">  #define writeSCK_H *sck_register |= sck_bm</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">  #define writeSCK_L *sck_register &amp;= ~sck_bm</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">  #define readMISO *miso_register &amp; miso_bm</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#elif defined(ARDUINO_ARCH_SAM) // DUE:700kHz</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;  <span class="comment">// by stimmer https://forum.arduino.cc/index.php?topic=129868.msg980466#msg980466</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">  #define writeMOSI_H g_APinDescription[mosi_pin].pPort -&gt; PIO_SODR = g_APinDescription[mosi_pin].ulPin</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">  #define writeMOSI_L g_APinDescription[mosi_pin].pPort -&gt; PIO_CODR = g_APinDescription[mosi_pin].ulPin</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">  #define writeSCK_H g_APinDescription[sck_pin].pPort -&gt; PIO_SODR = g_APinDescription[sck_pin].ulPin</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">  #define writeSCK_L g_APinDescription[sck_pin].pPort -&gt; PIO_CODR = g_APinDescription[sck_pin].ulPin</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">  #define readMISO PIO_Get( g_APinDescription[miso_pin].pPort, PIO_INPUT, g_APinDescription[miso_pin].ulPin )</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#elif defined(TARGET_LPC1768)</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;  <span class="comment">//typedef volatile LPC_GPIO_TypeDef* fastio_reg;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  <span class="comment">//typedef uint32_t fastio_bm;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">  #define writeMOSI_H LPC176x::gpio_set(mosi_pin)</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">  #define writeMOSI_L LPC176x::gpio_clear(mosi_pin)</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">  #define writeSCK_H LPC176x::delay_ns(240); LPC176x::gpio_set(sck_pin)</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">  #define writeSCK_L LPC176x::delay_ns(240); LPC176x::gpio_clear(sck_pin)</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">  #define readMISO LPC176x::gpio_get(miso_pin)</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#elif defined(__STM32F1__) || defined(TARGET_STM32F1)</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">  #define writeMOSI_H digitalWrite(mosi_pin, HIGH)</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">  #define writeMOSI_L digitalWrite(mosi_pin, LOW)</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">  #define writeSCK_H digitalWrite(sck_pin, HIGH)</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">  #define writeSCK_L digitalWrite(sck_pin, LOW)</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">  #define readMISO digitalRead(miso_pin)</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#else // DUE:116kHz</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="_t_m_c__platforms_8h.html#aae28defc4c391982df05cb414663956e">   32</a></span>&#160;<span class="preprocessor">  #define writeMOSI_H digitalWrite(mosi_pin, HIGH)</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="_t_m_c__platforms_8h.html#a00ddb733cb8aae0fc31326e4163cc638">   33</a></span>&#160;<span class="preprocessor">  #define writeMOSI_L digitalWrite(mosi_pin, LOW)</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="_t_m_c__platforms_8h.html#a889f92ec583d898b35cf083e12ef371a">   34</a></span>&#160;<span class="preprocessor">  #define writeSCK_H digitalWrite(sck_pin, HIGH)</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="_t_m_c__platforms_8h.html#a595d617b4d8e35526e7c38367baf637c">   35</a></span>&#160;<span class="preprocessor">  #define writeSCK_L digitalWrite(sck_pin, LOW)</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="_t_m_c__platforms_8h.html#a1b0729059441b53f83a633fbf0ab315f">   36</a></span>&#160;<span class="preprocessor">  #define readMISO digitalRead(miso_pin)</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_94e7a0fbe7f8eaf7f05ee7b02c647e9f.html">source</a></li><li class="navelem"><a class="el" href="_t_m_c__platforms_8h.html">TMC_platforms.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
